package tt.dz.dao.pro;

import java.util.List;

import org.springframework.stereotype.Repository;

import tt.dz.dao.base.BaseDao;
import tt.dz.entity.UserRechargeBill;

/**
 * 用户充值业务操作Dao类
 * @author xielf
 *
 * @param <T>
 */
@Repository
public class UserRechargeBillDao<T> extends BaseDao<T> {

	
	public UserRechargeBill findUserRechargeByRechargeIdAndUserId(String alipayTradeNum,Integer userId){
		
		List<T> listRechargeBills = super.findByHql("from UserRechargeBill where alipay_trade_num=? and user_id=?", alipayTradeNum, userId);
		if(listRechargeBills!=null && listRechargeBills.size()>0){
			return (UserRechargeBill) listRechargeBills.get(0);
		}
		return null;
	}
	
}
